package org.jiajie.designpatterndemo.strategy.geek;

/**
 * 策略的使用
 * @author jay
 */
public class OrderService {

    public double discount(Order order) {
        OrderType type = order.getType();
        DiscountStrategy discountStrategy = DiscountStrategyFactory.getDiscountStrategy(type);
        return discountStrategy.calDiscount(order);
    }
}
